<template>
  <view class="songs_comment">评论页面</view>
</template>

<script>
export default {
  data() {
    return {
      id: '',
      songsDetail: []
    }
  },
  onLoad(options) {
    this.id = options.id
    this.getSongsComment()
    console.log(options)
    this.getSongsDetail()
  },
  methods: {
    async getSongsComment() {
      const { data: res } = await uni.$http.get('comment/music', { id: this.id, limit: 10 })
      console.log(res)
    },
    async getSongsDetail() {
      const { data: res } = await uni.$http.get('song/detail', { ids: this.id })
      console.log(res);
      if (res.code !== 200) return uni.$showMsg('歌曲详情数据获取失败')
      this.songsDetail = res.songs
    }
  }
}
</script>

<style lang="scss"></style>
